-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GT-2450 Add support for PageCollectionPages in CYOA tools #700
base: main
Are you sure you want to change the base?
Conversation
Typescript headers
kotlin-mpp-godtools-tool-parser-publishing-npm.d.ts--- a/home/runner/work/kotlin-mpp-godtools-tool-parser/kotlin-mpp-godtools-tool-parser/diff/base/kotlin-mpp-godtools-tool-parser-publishing-npm.d.ts
+++ b/home/runner/work/kotlin-mpp-godtools-tool-parser/kotlin-mpp-godtools-tool-parser/diff/head/kotlin-mpp-godtools-tool-parser-publishing-npm.d.ts
@@ -102,6 +102,7 @@ export declare namespace org.cru.godtools.shared.tool.parser {
get FEATURE_CONTENT_CARD(): string;
get FEATURE_FLOW(): string;
get FEATURE_MULTISELECT(): string;
+ get FEATURE_PAGE_COLLECTION(): string;
};
}
}
@@ -491,6 +492,16 @@ export declare namespace org.cru.godtools.shared.tool.parser.model {
};
}
}
+export declare namespace org.cru.godtools.shared.tool.parser.model {
+ interface HasPages /* extends org.cru.godtools.shared.tool.parser.model.Base */ {
+ readonly _pages: kotlin.collections.KtList<org.cru.godtools.shared.tool.parser.model.page.Page>;
+ findPage(id: Nullable<string>): Nullable<org.cru.godtools.shared.tool.parser.model.page.Page>;
+ readonly pages: Array<org.cru.godtools.shared.tool.parser.model.page.Page>;
+ readonly __doNotUseOrImplementIt: {
+ readonly "org.cru.godtools.shared.tool.parser.model.HasPages": unique symbol;
+ };
+ }
+}
export declare namespace org.cru.godtools.shared.tool.parser.model {
/* @ts-ignore: extends class with private primary constructor */
class Image extends org.cru.godtools.shared.tool.parser.model.Content implements org.cru.godtools.shared.tool.parser.model.Clickable {
@@ -589,7 +600,7 @@ export declare namespace org.cru.godtools.shared.tool.parser.model {
}
}
export declare namespace org.cru.godtools.shared.tool.parser.model {
- class Manifest /* extends org.cru.godtools.shared.tool.parser.model.BaseModel */ /* implements org.cru.godtools.shared.tool.parser.model.Styles */ {
+ class Manifest /* extends org.cru.godtools.shared.tool.parser.model.BaseModel */ implements org.cru.godtools.shared.tool.parser.model.HasPages/*, org.cru.godtools.shared.tool.parser.model.Styles */ {
private constructor();
get code(): Nullable<string>;
get locale(): Nullable<string>;
@@ -603,11 +614,12 @@ export declare namespace org.cru.godtools.shared.tool.parser.model {
set _pages(value: kotlin.collections.KtList<org.cru.godtools.shared.tool.parser.model.page.Page>);
get shareables(): kotlin.collections.KtList<any/* org.cru.godtools.shared.tool.parser.model.shareable.Shareable */>;
get relatedFiles(): kotlin.collections.KtSet<string>;
- static createTestManifest(config?: org.cru.godtools.shared.tool.parser.ParserConfig, type?: org.cru.godtools.shared.tool.parser.model.Manifest.Type, code?: Nullable<string>, locale?: Nullable<string>, primaryColor?: string, primaryTextColor?: string, navBarColor?: Nullable<string>, navBarControlColor?: Nullable<string>, backgroundColor?: string, cardBackgroundColor?: Nullable<string>, categoryLabelColor?: Nullable<string>, pageControlColor?: string, multiselectOptionBackgroundColor?: Nullable<string>, multiselectOptionSelectedColor?: Nullable<string>, textColor?: string, textScale?: number, resources?: Nullable<(p0: org.cru.godtools.shared.tool.parser.model.Manifest) => kotlin.collections.KtList<org.cru.godtools.shared.tool.parser.model.Resource>>, shareables?: Nullable<(p0: org.cru.godtools.shared.tool.parser.model.Manifest) => kotlin.collections.KtList<any/* org.cru.godtools.shared.tool.parser.model.shareable.Shareable */>>, tips?: Nullable<(p0: org.cru.godtools.shared.tool.parser.model.Manifest) => kotlin.collections.KtList<any/* org.cru.godtools.shared.tool.parser.model.tips.Tip */>>, pages?: Nullable<(p0: org.cru.godtools.shared.tool.parser.model.Manifest) => kotlin.collections.KtList<org.cru.godtools.shared.tool.parser.model.page.Page>>): org.cru.godtools.shared.tool.parser.model.Manifest;
+ static createTestManifest(config?: org.cru.godtools.shared.tool.parser.ParserConfig, type?: org.cru.godtools.shared.tool.parser.model.Manifest.Type, code?: Nullable<string>, locale?: Nullable<string>, primaryColor?: string, primaryTextColor?: string, navBarColor?: Nullable<string>, navBarControlColor?: Nullable<string>, backgroundColor?: string, cardBackgroundColor?: Nullable<string>, categoryLabelColor?: Nullable<string>, pageControlColor?: string, multiselectOptionBackgroundColor?: Nullable<string>, multiselectOptionSelectedColor?: Nullable<string>, textColor?: string, textScale?: number, resources?: Nullable<(p0: org.cru.godtools.shared.tool.parser.model.Manifest) => kotlin.collections.KtList<org.cru.godtools.shared.tool.parser.model.Resource>>, shareables?: Nullable<(p0: org.cru.godtools.shared.tool.parser.model.Manifest) => kotlin.collections.KtList<any/* org.cru.godtools.shared.tool.parser.model.shareable.Shareable */>>, tips?: Nullable<(p0: org.cru.godtools.shared.tool.parser.model.Manifest) => kotlin.collections.KtList<any/* org.cru.godtools.shared.tool.parser.model.tips.Tip */>>, pages?: Nullable<(p0: org.cru.godtools.shared.tool.parser.model.Manifest) => kotlin.collections.KtList<org.cru.godtools.shared.tool.parser.model.page.Page>>, pageXmlFiles?: kotlin.collections.KtList<org.cru.godtools.shared.tool.parser.model.Manifest.XmlFile>): org.cru.godtools.shared.tool.parser.model.Manifest;
get hasTips(): boolean;
- findPage(id: Nullable<string>): Nullable<org.cru.godtools.shared.tool.parser.model.page.Page>;
get dismissListeners(): Array<org.cru.godtools.shared.tool.parser.model.EventId>;
+ findPage(id: Nullable<string>): Nullable<org.cru.godtools.shared.tool.parser.model.page.Page>;
get pages(): Array<org.cru.godtools.shared.tool.parser.model.page.Page>;
+ readonly __doNotUseOrImplementIt: org.cru.godtools.shared.tool.parser.model.HasPages["__doNotUseOrImplementIt"];
}
namespace Manifest {
abstract class Type {
@@ -637,6 +649,13 @@ export declare namespace org.cru.godtools.shared.tool.parser.model {
static values(): Array<org.cru.godtools.shared.tool.parser.model.Manifest.Type>;
static valueOf(value: string): org.cru.godtools.shared.tool.parser.model.Manifest.Type;
}
+ class XmlFile {
+ constructor(name: Nullable<string>, src: string);
+ copy(name?: Nullable<string>, src?: string): org.cru.godtools.shared.tool.parser.model.Manifest.XmlFile;
+ toString(): string;
+ hashCode(): number;
+ equals(other: Nullable<any>): boolean;
+ }
}
}
export declare namespace org.cru.godtools.shared.tool.parser.model {
@@ -913,6 +932,7 @@ export declare namespace org.cru.godtools.shared.tool.parser.model.page {
get id(): string;
get position(): number;
get parentPage(): Nullable<org.cru.godtools.shared.tool.parser.model.page.Page>;
+ get parentPageParams(): kotlin.collections.KtMap<string, string>;
get nextPage(): Nullable<org.cru.godtools.shared.tool.parser.model.page.Page>;
get previousPage(): Nullable<org.cru.godtools.shared.tool.parser.model.page.Page>;
get isHidden(): boolean;
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #700 +/- ##
==========================================
- Coverage 86.15% 86.01% -0.14%
==========================================
Files 93 95 +2
Lines 2260 2331 +71
Branches 529 550 +21
==========================================
+ Hits 1947 2005 +58
- Misses 123 126 +3
- Partials 190 200 +10 ☔ View full report in Codecov by Sentry. |
iOS Framework headers
GodToolsToolParser.h--- a/Users/runner/work/kotlin-mpp-godtools-tool-parser/kotlin-mpp-godtools-tool-parser/diff/base/GodToolsToolParser.h
+++ b/Users/runner/work/kotlin-mpp-godtools-tool-parser/kotlin-mpp-godtools-tool-parser/diff/head/GodToolsToolParser.h
@@ -6,9 +6,9 @@
#import <Foundation/NSString.h>
#import <Foundation/NSValue.h>
-@class GTTPAnalyticsActionNames, GTTPAnalyticsAppSectionNames, GTTPAnalyticsScreenNames, GTTPAnalyticsUserProperties, GTTPTutorialAnalyticsActionNames, GTTPTutorialAnalyticsAppSectionNames, GTTPKotlinEnumCompanion, GTTPKotlinEnum<E>, GTTPLogLevel, GTTPKotlinArray<T>, GTTPToolAnalyticsActionNames, GTTPToolAnalyticsScreenNames, GTTPCardCollectionPageCard, GTTPPage, GTTPLessonPage, GTTPTipPage, GTTPTractPage, GTTPTractPageCard, GTTPXmlPullParserFactory, GTTPParserConfig, GTTPParserResult, GTTPManifestParser, GTTPParserConfigCompanion, GTTPDeviceType, GTTPKotlinx_coroutines_coreCoroutineDispatcher, GTTPManifest, GTTPKotlinThrowable, GTTPParserResultError, GTTPBaseModel, GTTPState, GTTPFlowWatcher, GTTPParser_expressionsExpression, GTTPTip, GTTPContent, GTTPAccordionSection, GTTPAnalyticsEvent, GTTPAnalyticsEventTrigger, GTTPText, GTTPAnalyticsEventSystem, GTTPEventId, NSURL, GTTPResource, GTTPAspectRatio, UIColor, GTTPGravityHorizontal, GTTPButtonStyle, GTTPDimension, GTTPTextAlign, GTTPDimensionPercent, GTTPDimensionPixels, GTTPEventIdCompanion, GTTPFlowItem, GTTPFlowItemCompanion, GTTPFlow, GTTPGravityVertical, GTTPGravityCompanion, GTTPGravity, GTTPImageScaleType, GTTPInputError, GTTPInputType, GTTPInputErrorInvalidEmail, GTTPInputErrorRequired, GTTPManifestType, NSLocale, GTTPShareable, GTTPCategory, GTTPMultiselectOption, GTTPMultiselect, GTTPMultiselectOptionStyle, GTTPParagraph, GTTPSpacerMode, GTTPStylesCompanion, GTTPTabsTab, GTTPTextStyle, GTTPVideoProvider, GTTPCardCollectionPage, GTTPTipType, GTTPCallToAction, GTTPModal, GTTPHeader, GTTPHero, GTTPSaxXmlPullParserQName, GTTPSaxXmlPullParser, NSXMLParser, NSData, GTTPKotlinException, GTTPUserCounterNames, GTTPBadge, GTTPBadgeBadgeType, GTTPIconColors, GTTPUserActivity, GTTPUserActivityColors, GTTPButton, GTTPCommonThemeType, GTTPKotlinRuntimeException, GTTPKotlinIllegalStateException, GTTPKotlinAbstractCoroutineContextElement, GTTPKotlinx_coroutines_coreCoroutineDispatcherKey, GTTPColormathAnsi16, GTTPColormathAnsi256, GTTPKotlinFloatArray, GTTPColormathCMYK, GTTPColormathHPLuv, GTTPColormathHSL, GTTPColormathHSLuv, GTTPColormathHSV, GTTPColormathHWB, GTTPColormathICtCp, GTTPColormathJzAzBz, GTTPColormathJzCzHz, GTTPColormathLAB, GTTPColormathLCHab, GTTPColormathLCHuv, GTTPColormathLUV, GTTPColormathOklab, GTTPColormathOklch, GTTPColormathRGB, GTTPColormathXYZ, GTTPKotlinAbstractCoroutineContextKey<B, E>, GTTPColormathAnsi16Companion, GTTPColormathAnsi256Companion, GTTPKotlinFloatIterator, GTTPColormathCMYKCompanion, GTTPColormathHPLuvCompanion, GTTPColormathHSLCompanion, GTTPColormathHSLuvCompanion, GTTPColormathHSVCompanion, GTTPColormathHWBCompanion, GTTPColormathICtCpCompanion, GTTPColormathJzAzBzCompanion, GTTPColormathJzCzHzCompanion, GTTPColormathLABCompanion, GTTPColormathLCHabCompanion, GTTPColormathLCHuvCompanion, GTTPColormathLUVCompanion, GTTPColormathOklabCompanion, GTTPColormathOklchCompanion, GTTPColormathRGBCompanion, GTTPColormathRenderCondition, GTTPColormathXYZCompanion, GTTPColormathxyY, GTTPColormathColorComponentInfo, GTTPColormathWhitePoint;
+@class GTTPAnalyticsActionNames, GTTPAnalyticsAppSectionNames, GTTPAnalyticsScreenNames, GTTPAnalyticsUserProperties, GTTPTutorialAnalyticsActionNames, GTTPTutorialAnalyticsAppSectionNames, GTTPKotlinEnumCompanion, GTTPKotlinEnum<E>, GTTPLogLevel, GTTPKotlinArray<T>, GTTPToolAnalyticsActionNames, GTTPToolAnalyticsScreenNames, GTTPCardCollectionPageCard, GTTPPage, GTTPLessonPage, GTTPTipPage, GTTPTractPage, GTTPTractPageCard, GTTPXmlPullParserFactory, GTTPParserConfig, GTTPParserResult, GTTPManifestParser, GTTPParserConfigCompanion, GTTPDeviceType, GTTPKotlinx_coroutines_coreCoroutineDispatcher, GTTPManifest, GTTPKotlinThrowable, GTTPParserResultError, GTTPBaseModel, GTTPState, GTTPFlowWatcher, GTTPParser_expressionsExpression, GTTPTip, GTTPContent, GTTPAccordionSection, GTTPAnalyticsEvent, GTTPAnalyticsEventTrigger, GTTPText, GTTPAnalyticsEventSystem, GTTPEventId, NSURL, GTTPResource, GTTPAspectRatio, UIColor, GTTPGravityHorizontal, GTTPButtonStyle, GTTPDimension, GTTPTextAlign, GTTPDimensionPercent, GTTPDimensionPixels, GTTPEventIdCompanion, GTTPFlowItem, GTTPFlowItemCompanion, GTTPFlow, GTTPGravityVertical, GTTPGravityCompanion, GTTPGravity, GTTPImageScaleType, GTTPInputError, GTTPInputType, GTTPInputErrorInvalidEmail, GTTPInputErrorRequired, GTTPManifestType, NSLocale, GTTPShareable, GTTPManifestXmlFile, GTTPCategory, GTTPMultiselectOption, GTTPMultiselect, GTTPMultiselectOptionStyle, GTTPParagraph, GTTPSpacerMode, GTTPStylesCompanion, GTTPTabsTab, GTTPTextStyle, GTTPVideoProvider, GTTPCardCollectionPage, GTTPPageCollectionPageCompanion, GTTPTipType, GTTPCallToAction, GTTPModal, GTTPHeader, GTTPHero, GTTPSaxXmlPullParserQName, GTTPSaxXmlPullParser, NSXMLParser, NSData, GTTPKotlinException, GTTPUserCounterNames, GTTPBadge, GTTPBadgeBadgeType, GTTPIconColors, GTTPUserActivity, GTTPUserActivityColors, GTTPButton, GTTPCommonThemeType, GTTPKotlinRuntimeException, GTTPKotlinIllegalStateException, GTTPKotlinAbstractCoroutineContextElement, GTTPKotlinx_coroutines_coreCoroutineDispatcherKey, GTTPColormathAnsi16, GTTPColormathAnsi256, GTTPKotlinFloatArray, GTTPColormathCMYK, GTTPColormathHPLuv, GTTPColormathHSL, GTTPColormathHSLuv, GTTPColormathHSV, GTTPColormathHWB, GTTPColormathICtCp, GTTPColormathJzAzBz, GTTPColormathJzCzHz, GTTPColormathLAB, GTTPColormathLCHab, GTTPColormathLCHuv, GTTPColormathLUV, GTTPColormathOklab, GTTPColormathOklch, GTTPColormathRGB, GTTPColormathXYZ, GTTPKotlinAbstractCoroutineContextKey<B, E>, GTTPColormathAnsi16Companion, GTTPColormathAnsi256Companion, GTTPKotlinFloatIterator, GTTPColormathCMYKCompanion, GTTPColormathHPLuvCompanion, GTTPColormathHSLCompanion, GTTPColormathHSLuvCompanion, GTTPColormathHSVCompanion, GTTPColormathHWBCompanion, GTTPColormathICtCpCompanion, GTTPColormathJzAzBzCompanion, GTTPColormathJzCzHzCompanion, GTTPColormathLABCompanion, GTTPColormathLCHabCompanion, GTTPColormathLCHuvCompanion, GTTPColormathLUVCompanion, GTTPColormathOklabCompanion, GTTPColormathOklchCompanion, GTTPColormathRGBCompanion, GTTPColormathRenderCondition, GTTPColormathXYZCompanion, GTTPColormathxyY, GTTPColormathColorComponentInfo, GTTPColormathWhitePoint;
-@protocol GTTPKotlinComparable, GTTPBase, GTTPKotlinx_coroutines_coreFlow, GTTPVisibility, GTTPParent, GTTPHasAnalyticsEvents, GTTPClickable, GTTPStyles, GTTPParcelable, GTTPColormathColor, GTTPKotlinIterator, GTTPKotlinCoroutineContextKey, GTTPKotlinCoroutineContextElement, GTTPKotlinCoroutineContext, GTTPKotlinContinuation, GTTPKotlinContinuationInterceptor, GTTPKotlinx_coroutines_coreRunnable, GTTPKotlinx_coroutines_coreFlowCollector, GTTPColormathColorSpace, GTTPColormathHueColor, GTTPColormathLABColorSpace, GTTPColormathLCHabColorSpace, GTTPColormathLCHuvColorSpace, GTTPColormathLUVColorSpace, GTTPColormathRGBColorSpace, GTTPColormathXYZColorSpace, GTTPColormathWhitePointColorSpace, GTTPColormathRGBColorSpaceTransferFunctions;
+@protocol GTTPKotlinComparable, GTTPBase, GTTPKotlinx_coroutines_coreFlow, GTTPVisibility, GTTPParent, GTTPHasAnalyticsEvents, GTTPClickable, GTTPStyles, GTTPHasPages, GTTPParcelable, GTTPColormathColor, GTTPKotlinIterator, GTTPKotlinCoroutineContextKey, GTTPKotlinCoroutineContextElement, GTTPKotlinCoroutineContext, GTTPKotlinContinuation, GTTPKotlinContinuationInterceptor, GTTPKotlinx_coroutines_coreRunnable, GTTPKotlinx_coroutines_coreFlowCollector, GTTPColormathColorSpace, GTTPColormathHueColor, GTTPColormathLABColorSpace, GTTPColormathLCHabColorSpace, GTTPColormathLCHuvColorSpace, GTTPColormathLUVColorSpace, GTTPColormathRGBColorSpace, GTTPColormathXYZColorSpace, GTTPColormathWhitePointColorSpace, GTTPColormathRGBColorSpaceTransferFunctions;
NS_ASSUME_NONNULL_BEGIN
#pragma clang diagnostic push
@@ -356,6 +356,7 @@ __attribute__((swift_name("ParserConfig.Companion")))
@property (readonly) NSString *FEATURE_CONTENT_CARD __attribute__((swift_name("FEATURE_CONTENT_CARD")));
@property (readonly) NSString *FEATURE_FLOW __attribute__((swift_name("FEATURE_FLOW")));
@property (readonly) NSString *FEATURE_MULTISELECT __attribute__((swift_name("FEATURE_MULTISELECT")));
+@property (readonly) NSString *FEATURE_PAGE_COLLECTION __attribute__((swift_name("FEATURE_PAGE_COLLECTION")));
@end
__attribute__((swift_name("ParserResult")))
@@ -750,6 +751,13 @@ __attribute__((swift_name("Gravity.Vertical")))
@property (class, readonly) NSArray<GTTPGravityVertical *> *entries __attribute__((swift_name("entries")));
@end
+__attribute__((swift_name("HasPages")))
+@protocol GTTPHasPages <GTTPBase>
+@required
+- (GTTPPage * _Nullable)findPageId:(NSString * _Nullable)id __attribute__((swift_name("findPage(id:)")));
+@property (readonly) NSArray<GTTPPage *> *pages __attribute__((swift_name("pages")));
+@end
+
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("Image")))
@interface GTTPImage : GTTPContent <GTTPClickable>
@@ -836,10 +844,9 @@ __attribute__((swift_name("Link")))
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("Manifest")))
-@interface GTTPManifest : GTTPBaseModel <GTTPStyles>
-- (instancetype)initWithConfig:(GTTPParserConfig *)config type:(GTTPManifestType *)type code:(NSString * _Nullable)code locale:(NSLocale * _Nullable)locale primaryColor:(UIColor *)primaryColor primaryTextColor:(UIColor *)primaryTextColor navBarColor:(UIColor * _Nullable)navBarColor navBarControlColor:(UIColor * _Nullable)navBarControlColor backgroundColor:(UIColor *)backgroundColor cardBackgroundColor:(UIColor * _Nullable)cardBackgroundColor categoryLabelColor:(UIColor * _Nullable)categoryLabelColor pageControlColor:(UIColor *)pageControlColor multiselec See the full diff from https://github.com/CruGlobal/kotlin-mpp-godtools-tool-parser/actions/runs/11488757388 |
c8c541a
to
01c8bfc
Compare
068aa1c
to
631ee96
Compare
…ify what types of pages it supports
631ee96
to
2f9bc66
Compare
...c/commonTest/kotlin/org/cru/godtools/shared/tool/parser/model/page/PageCollectionPageTest.kt
Fixed
Show fixed
Hide fixed
2f9bc66
to
e36e371
Compare
this is meant as a temporary workaround to allow older versions of the parser to continue to depend upon the parent attribute
This adds support for parsing the new page collection page type for CYOA tools. This functionality is behind a new
FEATURE_PAGE_COLLECTION
feature flag that can be enabled when you are ready to use the functionality.a
PageCollectionPage
contains a list of pages that should be rendered as a swipeable view pager.TODO:
parentPage
when that parent is actually a page in aPageCollectionPage